
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter/src/widgets/framework.dart';
import 'package:reabampos/src/reabam/operation/rb_api.dart';
import 'package:reabampos/src/reabam/operation/rb_config.dart';
import 'package:reabampos/src/reabam/ui_self_service/pagestate_ss_home_index.dart';
import 'package:reabampos/src/reabam/ui_self_service/pagestate_ss_login.dart';
import 'package:reabampos/src/reabam/ui_self_service/shoppingcart/pagestate_ss_manual_input_gooditem_barcode_search.dart';
import 'package:reabampos/src/reabam/utils/rb_color.dart';
import 'package:reabampos/src/reabam/utils/rb_widget_ss.dart';
import 'package:xsdk_flutter/xsdk/utils/x_utils_string.dart';
import 'package:xsdk_flutter/xsdk/xsdk_flutter_package.dart';

/*
支付结果
 */
class PageStateSelfServicePayResult extends XPageState{


  PageStateSelfServicePayResult();

  @override
  void onStart() {


  }

  @override
  Widget getBodyWidget(BuildContext context) {
    return XWidgetUtils.getLayoutContainer(
        alignment: Alignment.topCenter,
        padding: XWidgetUtils.getEdgeInsets(0, 477, 0, 0),
        child: XWidgetUtils.getLayoutColumn(
            crossAxisAlignment :CrossAxisAlignment.center,
            children: [
              XImageUtils.getImageWidgetWithAsset(
                'ss_pay_result_1.png',
                width: 161,
                height: 160,
              ),
              XWidgetUtils.getWidgetText(
                  '¥支付成功',
                  style: XStyleUtils.getTextStyle(
                      fontSize: 60,
                      color: XColorUtils.color333333,
                  )
              ),
              XWidgetUtils.getLayoutContainer(
                  alignment: Alignment.center,
                  margin: XWidgetUtils.getEdgeInsets(0, 59, 0, 0),
                  child: XWidgetUtils.getLayoutRow(
                      mainAxisSize:MainAxisSize.min,
                      mainAxisAlignment:MainAxisAlignment.center,
                      children: [
                        XWidgetUtils.getWidgetText(
                            '共',
                            style: XStyleUtils.getTextStyle(
                              fontSize: 50,
                              color: XColorUtils.color333333,
                              fontWeight: FontWeight.bold
                            )
                        ),
                        XWidgetUtils.getWidgetText(
                            '13',
                            style: XStyleUtils.getTextStyle(
                                fontSize: 50,
                                color: const Color(0xFFFF0020),
                                fontWeight: FontWeight.bold
                            )
                        ),
                        XWidgetUtils.getWidgetText(
                            '件，¥ 280.00',
                            style: XStyleUtils.getTextStyle(
                                fontSize: 50,
                                color: XColorUtils.color333333,
                                fontWeight: FontWeight.bold
                            )
                        ),
                      ]
                  )
              ),
              RBWidgets_SelfService.getButton(
                  text: '完成交易（3s）',
                  fontColor:RBColors.reabamColor4,
                  backgroundColor:Colors.white,
                  borderColor: RBColors.reabamColor4,
                  margin: XWidgetUtils.getEdgeInsets(90, 109, 90, 0),
                  onPressed: (){
                    startPage(StatePageSelfServiceHomeIndex(),cleanUntilRetainPageName: '/');
                  }
              ),
              const Spacer(),
              XWidgetUtils.getWidgetText(
                '请取走商品和小票',
                style: XStyleUtils.getTextStyle(
                  fontSize: 40,
                  color: XColorUtils.color333333,
                ),
                padding: XWidgetUtils.getEdgeInsets(0, 0, 0, 82),
              ),

            ]
        )
    );
  }



  @override
  Future<void> updateData({int pageIndex = 1}) async {
  }


  @override
  Color getXPageBackgroundColor() {
    return Colors.white;
  }


}